// 对外暴露路由配置(常量路由)
export const constantRoute = [
  // 登录
  {
    name: 'login',
    path: '/login',
    component: () => import('@/views/mis/login/index.vue'),
    meta: {
      title: '登录',
      hidden: true,
      icon: 'Loading',
    },
  },
  // 首页路由 - 添加在导航栏顶部
  {
    name: 'Dashboard',
    path: '/dashboard',
    component: () => import('@/layout/index.vue'),
    meta: {
      title: '首页',
      hidden: false,
      icon: 'HomeFilled',
    },
    redirect: '/dashboard',
    children: [
      {
        path: '/dashboard',
        component: () => import('@/views/mis/home/index.vue'),
        meta: {
          title: '首页',
          hidden: false,
          icon: 'HomeFilled',
        },
      },
    ],
  },
  // layout
  {
    name: '后台首页',
    path: '/home',
    component: () => import('@/layout/index.vue'),
    meta: {
      title: '后台首页',
      hidden: true,
      icon: 'HomeFilled',
    },
    redirect: '/home',
    children: [
      {
        path: '/home',
        component: () => import('@/views/mis/home/index.vue'),
        meta: {
          title: '首页', //用于展示菜单标题
          hidden: false, //用于控制路由在菜单中的显示与隐藏 true表示隐藏
          icon: 'HomeFilled', //用于设置菜单标题前面的图标
        },
      },
      {
        name: '系统设置',
        path: '/settings',
        component: () => import('@/views/mis/home/settings.vue'),
        meta: {
          title: '系统设置',
          icon: 'Setting',
          hidden: false,
        },
      },
    ],
  },
  {
    name: 'Content',
    path: '/content',
    component: () => import('@/layout/index.vue'),
    meta: {
      title: '内容管理',
      icon: 'MessageBox',
      hidden: false,
    },
    redirect: '/content/category',
    children: [
      {
        name: 'Category',
        path: '/content/category',
        component: () => import('@/views/mis/content/category.vue'),
        meta: {
          title: '分类管理',
          icon: 'Folder',
          hidden: false,
        },
      },
      {
        name: 'Video',
        path: '/content/video',
        component: () => import('@/views/mis/content/video.vue'),
        meta: {
          title: '视频管理',
          hidden: false,
          icon: 'VideoPlay',
        },
      },
    ],
  },

  {
    name: 'Interact',
    path: '/interact',
    component: () => import('@/layout/index.vue'),
    meta: {
      title: '互动管理',
      icon: 'Connection',
      hidden: false,
    },
    redirect: '/interact/comment',
    children: [
      {
        name: 'Comment',
        path: '/interact/comment',
        component: () => import('@/views/mis/interact/comment.vue'),
        meta: {
          title: '评论管理',
          icon: 'ChatDotSquare',
          hidden: false,
        },
      },
      {
        name: 'Danmaku',
        path: '/interact/danmaku',
        component: () => import('@/views/mis/interact/danmaku.vue'),
        meta: {
          title: '弹幕管理',
          hidden: false,
          icon: 'Connection',
        },
      },
      {
        name: 'User',
        path: '/interact/user',
        component: () => import('@/views/mis/interact/user.vue'),
        meta: {
          title: '用户管理',
          hidden: false,
          icon: 'UserFilled',
        },
      },
    ],
  },
  {
    name: 'FrontHead',
    path: '/',
    component: () => import('@/views/front/FrontLayout.vue'),
    meta: {
      title: '前台头部',
      hidden: true,
    },
    redirect: '/front/home',
    children: [
      {
        name: 'FrontHome',
        path: '/front/home',
        component: () => import('@/views/front/Home.vue'),
        meta: {
          title: '前台首页',
          hidden: true,
        },
      },
      {
        name: 'VideoUpload',
        path: '/front/video/upload',
        component: () => import('@/views/front/upload/VideoUpload.vue'),
        meta: {
          title: '视频上传',
          hidden: true,
        },
      },
      {
        name: 'VideoDetail',
        path: '/front/videoDetail/:id',
        component: () => import('@/views/front/VideoDetail.vue'),
        meta: {
          title: '视频详情页',
          hidden: true,
        },
      },
      {
        name: 'VideoDetailNew',
        path: '/video/detail/:id',
        component: () => import('@/views/video/VideoDetail.vue'),
        meta: {
          title: '视频详情页(新)',
          hidden: true,
        },
      },
      {
        name: 'UserMoments',
        path: '/front/user/moments',
        component: () => import('@/views/front/UserMoments.vue'),
        meta: {
          title: '用户动态',
          hidden: true,
        },
      },
      {
        name: 'UserHistory',
        path: '/front/user/history',
        component: () => import('@/views/front/UserHistory.vue'),
        meta: {
          title: '用户历史',
          hidden: true,
        },
      },
      {
        name: 'UserHistoryNew',
        path: '/user/history',
        component: () => import('@/views/user/UserHistory.vue'),
        meta: {
          title: '历史记录',
          hidden: true,
        },
      },
      {
        name: 'UserMessages',
        path: '/front/user/messages',
        component: () => import('@/views/front/user/UserMessages.vue'),
        meta: {
          title: '消息中心',
          hidden: true,
        },
      },
      {
        name: 'UserMessagesNew',
        path: '/user/messages',
        component: () => import('@/views/front/user/UserMessages.vue'),
        meta: {
          title: '我的消息',
          hidden: true,
        },
      },
      {
        name: 'UserReplies',
        path: '/user/replies',
        component: () => import('@/views/front/user/UserReplies.vue'),
        meta: {
          title: '回复我的',
          hidden: true,
        },
      },
      {
        name: 'UserLikes',
        path: '/user/likes',
        component: () => import('@/views/front/user/UserLikes.vue'),
        meta: {
          title: '收到的赞',
          hidden: true,
        },
      },
      {
        name: 'UserSystemNotify',
        path: '/user/notify',
        component: () => import('@/views/front/user/UserSystemNotify.vue'),
        meta: {
          title: '系统通知',
          hidden: true,
        },
      },
      // 搜索页面路由
      {
        name: 'Search',
        path: '/front/search',
        component: () => import('@/views/front/search/SearchLayout.vue'),
        meta: {
          title: '搜索',
          hidden: true,
        },
        redirect: '/front/search/video',
        children: [
          {
            name: 'VideoSearch',
            path: '/front/search/video',
            component: () => import('@/views/front/search/VideoSearch.vue'),
            meta: {
              title: '视频搜索结果',
              hidden: true,
            },
          },
          {
            name: 'UserSearch',
            path: '/front/search/user',
            component: () => import('@/views/front/search/UserSearch.vue'),
            meta: {
              title: '用户搜索结果',
              hidden: true,
            },
          },
        ],
      },
      {
        name: 'CategoryVideo',
        path: '/category/:categoryId/:subCategoryId?',
        component: () => import('@/views/front/videoList/CategoryVideo.vue'),
        meta: {
          title: '分类视频',
          hidden: true,
        },
      },

      {
        name: 'UserSpace',
        path: '/space/:id?',
        component: () => import('@/views/myspace/index.vue'),
        meta: {
          title: '个人空间',
          hidden: true,
        },
        children: [
          {
            name: 'UserSpaceVideos',
            path: 'videos',
            component: () => import('@/views/myspace/index.vue'),
            meta: {
              title: '用户视频',
              hidden: true,
            },
          },
          {
            name: 'UserSpaceCollections',
            path: 'collections',
            component: () => import('@/views/myspace/index.vue'),
            meta: {
              title: '用户合集',
              hidden: true,
            },
          },
          {
            name: 'UserSpaceFavorites',
            path: 'favorites',
            component: () => import('@/views/myspace/index.vue'),
            meta: {
              title: '用户收藏',
              hidden: true,
            },
          },
          {
            name: 'UserSpaceSettings',
            path: 'settings',
            component: () => import('@/views/myspace/index.vue'),
            meta: {
              title: '用户设置',
              hidden: true,
            },
          },
          {
            name: 'UserSpaceCollectionDetail',
            path: 'collection/:collectionId',
            component: () => import('@/views/myspace/index.vue'),
            meta: {
              title: '合集详情',
              hidden: true,
            },
          },
        ],
      },
      // 收藏夹路由
      {
        name: 'UserFavorites',
        path: '/front/favorites/:id',
        component: () => import('@/views/front/Favorites.vue'),
        meta: {
          title: '收藏夹',
          hidden: true,
        },
      },
      // 合集路由
      {
        name: 'UserCollection',
        path: '/front/collection/:id',
        component: () => import('@/views/front/Collection.vue'),
        meta: {
          title: '视频合集',
          hidden: true,
        },
      },
      {
        name: 'CreateStudio',
        path: '/front/create',
        component: () => import('@/views/front/create/CreateCenter.vue'),
        meta: {
          title: '创作中心',
          hidden: true,
          requiresAuth: true,
        },
        children: [
          {
            path: 'content',
            name: 'CreateContentManage',
            component: () =>
              import('@/views/front/create/CreateContentManage.vue'),
            meta: {
              title: '内容管理',
              hidden: true,
            },
          },
          {
            path: 'comment',
            name: 'CreateCommentManage',
            component: () =>
              import('@/views/front/create/CreateCommentManage.vue'),
            meta: {
              title: '评论管理',
              hidden: true,
            },
          },
          {
            path: 'upload',
            name: 'UploadVideo',
            component: () => import('@/views/front/create/UploadComponent.vue'),
            meta: {
              title: '上传视频',
              hidden: true,
            },
          },
          {
            path: 'upload/detail',
            name: 'UploadDetail',
            component: () => import('@/views/front/create/UploadDetail.vue'),
            meta: {
              title: '投稿详情',
              hidden: true,
            },
          },
        ],
      },
    ],
  },
  // 404
  {
    name: '404',
    path: '/:pathMatch(.*)*',
    component: () => import('@/views/404/index.vue'),
    meta: {
      title: '404',
      hidden: true,
      icon: 'CloseBold',
    },
  },
]

// 任意路由
export const anyRoute = {
  name: 'any',
  path: '/:pathMatch(.*)*',
  redirect: '/404',
  meta: {
    title: '任意路由',
    hidden: true,
    icon: 'Compass',
  },
}
